package com.jk.testsql.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jk.testsql.annatation.MasterDB;
import com.jk.testsql.annatation.SlaveDB;
import com.jk.testsql.dao.SysUserMapper;
import com.jk.testsql.dto.SysUser;
import com.jk.testsql.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysUserServiceImpl implements SysUserService {

    @Autowired
    private SysUserMapper sysUserMapper;

    @SlaveDB
    @Override
    public List<SysUser> findSysUserList(SysUser sysUser) {
        return sysUserMapper.selectList(new QueryWrapper<>());
    }

    @MasterDB
    @Override
    public void addSysUser(SysUser sysUser) {
        sysUserMapper.insert(sysUser);
    }
}
